﻿using Klear.Library.Models;
using Klear.Library.Services;

namespace Klear.UnitTest;


using Xunit;


public class ChineseAlmanacServiceTests
{
    [Fact]
    public async void RunAsync_ReturnsAlmanacModel_WhenApiResponseIsSuccess()
    {
        var data=new ChineseAlmanacService();
        AlmanacModel res =await data.RunAsync();
        string httpDate = res.Gregoriandate;
        string localDate = DateTime.Now.ToString("yyyy-MM-dd");
        string year = "甲辰";
        string httpYear = res.Tiangandizhiyear;
        Assert.Equal(httpDate, localDate);
        Assert.Equal(httpYear, year);
    }
}
